package com.zzld.modules.autoinn.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zzld.core.service.BaseServiceImpl;
import com.zzld.modules.autoinn.entity.Product;
import com.zzld.modules.autoinn.mapper.ProductMapper;
import com.zzld.modules.autoinn.service.IProductService;

@Service("productService")
public class ProductServiceImpl extends BaseServiceImpl<Product> implements IProductService {
	
	@Autowired
	private ProductMapper productMapper;

	public PageInfo list(Map map,int PageNum,int PageSize){
		Map<String, Object> params = map;
		// 以name字段升序排序
		PageHelper.startPage(PageNum, PageSize);
		List<Product> list = productMapper.selectpage(map);
		PageInfo page = new PageInfo(list);

		return page;
	}
	
	public Integer insertpro(Product pro){
		return productMapper.insertpro(pro);
	}
	
	public Product selectid(String id){
		return productMapper.selectid(id);
	}
	
	public Product selectdan(String id){
		return productMapper.selectdan(id);
	}
}
